package com.ohuang.wallpapermanager.storage.storage

import android.content.Context

/**
 * 通过sp存数据
 */
class SpStorage<T>(val context: Context, val spUtil: SPUtil, val key:String, val defaultValue:T):
    IStorage<T> {
    override fun getValue(): T {
       return spUtil.get(context,key,defaultValue) as T
    }

    override fun setValue(value: T) {
        spUtil.put(context,key,value)
    }
}